<?php
	session_start();
	include ("includes/conn.php");
	
	header('Pragma: ' . 'public');
	header("Cache-Control: public");
	header('Expires: ' . gmdate('D, d M Y H:i:s', time()+(60*10)) . ' GMT'); 
	
	extract($_REQUEST, EXTR_PREFIX_ALL|EXTR_REFS, 'v');
	$countingbad=substr_count($v_keywords,'allinurl');
	if($countingbad>0){
		echo"<script language=javascript>alert('Please input VALID search words.');history.go(-1);</script>";
		exit;
	}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<?php include('includes/title.php');?>
<meta name="keywords" content="antibody,Pre-Made siRNA,siRNA,Pre-Made Lentivirus,Lentivirus,Pre-Made Adenovirus,adenovirus,adenoviral vector,custom adenoviral vector,adenovirus,rnai,rnai adenoviral vector,ABM,abm,applied biological materials,biological materials,gene expression system,gene transfer vectors,regulated gene expression,inducible expression system,tet regulated gene expression,retroviral vector,custom retroviral vector,retrovirus,gene expression,gene knockout,stable gene expression,pcr,taq polymerase,genetics,genetic materials,cell lysates,cell immortalization">
<link rel="shortcut icon" href="/images/logo.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="style/css.css" rel="stylesheet" type="text/css">
<script src="style/environment.js" type="text/javascript"></script>
</head>
<link href="/style/abmnew.css" rel="stylesheet" type="text/css">
<link href="/style/abmnewhome.css" rel="stylesheet" type="text/css">
<link href="/style/mirna.css" rel="stylesheet" type="text/css">
<style>
body {
	background-color:#FFF;
}
#foot {
	width:740px;
	border-top:1px solid #CCC;
	padding-top:5px;
	text-align:center;
}
#content{
	text-align:left;
	border:0px;
	padding-bottom:75px;
}
.cat_link:hover{
	color:#000;
	font-weight:bold;
	background-image: url(/StemCell/images/bg-btn-srch.jpg);
	background-repeat:repeat-x;
}

</style>
<script type="text/javascript">	
	function changeoption (){
		var grp = document.getElementById('srchby').value;
		if (grp == "1"){
			//document.getElementById('keywords').defaultValue = "search by product name";
			document.getElementById('keywords').value = "search by product name";
		}
		if (grp == "2"){
			//document.getElementById('keywords').defaultValue = "search by gene name (i.e. 'abca1')";
			document.getElementById('keywords').value = "search by gene name (i.e. 'abca1')";
		}
		if (grp == "3"){
			//document.getElementById('keywords').defaultValue = "search by catalogue number";
			document.getElementById('keywords').value = "search by catalogue number";
		}
                if (grp == "4"){
			//document.getElementById('keywords').defaultValue = "search by catalogue number";
			document.getElementById('keywords').value = "search by accession number";
		}
		if (grp == "5"){
			//document.getElementById('keywords').defaultValue = "search by miRNA name (i.e. 'let-7a')";
			document.getElementById('keywords').value = "search by miRNA name (i.e. 'let-7a')";
		}
		document.getElementById('keywords').style.fontFamily = 'arial,sans-serif,helvetica';
		document.getElementById('keywords').style.fontSize = '13px';
		document.getElementById('keywords').style.letterSpacing = '-0.5px';
		document.getElementById('keywords').style.color= '#F90';
		document.getElementById('keywords').size = '58';
	}
	
	function restoreback (){
		document.getElementById('keywords').style.color= '#F90';
		document.getElementById('keywords').style.fontSize = '13px';
		document.getElementById('keywords').style.fontFamily = 'arial,sans-serif,helvetica';
		document.getElementById('keywords').style.letterSpacing = '-0.5px';
		document.getElementById('keywords').value = document.getElementById('keywords').defaultValue;
	}
	
	function change_value (){
		document.getElementById('keywords').value = ""; 
		document.getElementById('keywords').style.fontSize = '13px';
		document.getElementById('keywords').style.color='#000000';
		document.getElementById('keywords').style.letterSpacing = '-0.5px';
		document.getElementById('keywords').size = '58';
		document.getElementById('keywords').style.fontFamily = 'arial,sans-serif,helvetica';
	}
</script>
<body>
<?php
include('./includes/header-homepage.php');
?>
<div id='content' style='width:810px; height:auto;'>
  <?php
	if (!isset($v_keywords)){
		echo "<script language=javascript>history.go(-1);</script>";
		exit;
	}elseif ($v_keywords==''){
		echo "<script language=javascript>alert('Please input search words.');history.go(-1);</script>";
		exit;
	}
	
	$srchkwd = $v_keywords;
	$keywords=strtolower($v_keywords);
	$keywords=trim($keywords);
	
	if (isset($v_srchby)){
		$srchby=$v_srchby;
	}
	
	switch ($srchby){
		case "1": // search by product name
			echo "<script language=javascript>document.getElementById('srchby').selectedIndex=0;</script>";
		
			$keywords = strtolower($keywords);
			
			$alphabet1=array ('α'=>'alpha','β'=>'beta','γ'=>'gamma','δ'=>'delta','ε'=>'epsilon','ζ'=>'zeta',
							 'η'=>'eta','θ'=>'theta','ι'=>'iota','κ'=>'kappa','λ'=>'lambda','μ'=>'mu',
							 'ν'=>'nu','ξ'=>'xi','ο'=>'omicron','π'=>'pi','ρ'=>'rho','ς'=>'sigmaf','σ'=>'sigma',
							 'τ'=>'tau','υ'=>'upsilon','φ'=>'phi','χ'=>'chi','ψ'=>'psi','ω'=>'omega');
			$alphabet2=array ('α'=>'a','β'=>'b','γ'=>'g','δ'=>'d','ε'=>'e','ζ'=>'z','ι'=>'i',
							 'κ'=>'k','λ'=>'l','μ'=>'m','ν'=>'n','ξ'=>'x','ο'=>'o','π'=>'p','ρ'=>'r','σ'=>'s','τ'=>'t',
							 'υ'=>'u');
			
			foreach ($alphabet1 as $k => $p){
				$pos =array("$p ","$p-"," $p","-$p","-$p-"," $p ","-$p "," $p-");
				foreach ($pos as $m){
					if (substr($keywords,0,strlen($m)) == $m){
						$keywords = "$k".substr($keywords,strlen($m));
					}elseif(substr($keywords,-1,strlen($m)) == $m){
						$keywords = substr($keywords,0,strlen($keywords)-strlen($m))."$k";
					}elseif(strpos($keywords,$m) !== false){
						$keywords = str_replace($m,$k,$keywords);
					}else{
						$keywords = str_replace($m,$k,$keywords);
					}
				}
			}
			
			//for non antibody products.
			$pattern = array("Positive Lysate with C-Ha Tag","Positive Lysate","-C HA Tag","-C His Tag","-N His Tag","-set","-HA","-His","-GFP-2A-Puro","-RFP-2A-Puro","-","/"," ",".","(",")",",",":","+");
			$keywords3 = str_replace($pattern,"",$keywords);
			foreach($alphabet2 as $k => $p){
				$keywords3 = str_replace($k,$p,$keywords3);
			}
			
			foreach ($alphabet2 as $k => $p){
				$pos =array("$p ","$p-"," $p","-$p","-$p-"," $p ","-$p "," $p-");
				foreach ($pos as $m){
					if (substr($keywords,0,strlen($m)) == $m){
						$keywords = "$k".substr($keywords,strlen($m));
					}elseif(substr($keywords,-1,strlen($m)) == $m){
						$keywords = substr($keywords,0,strlen($keywords)-strlen($m))."$k";
					}else{
						$keywords = str_replace($m,$k,$keywords);
					}
				}
			}
			$pattern = array("Positive Lysate with C-Ha Tag","Positive Lysate","with C-Ha Tag","-C HA Tag","-C His Tag","-N His Tag","-set","-HA","-His","-GFP-2A-Puro","-RFP-2A-Puro","-","/"," ",".","(",")",",",":","+");
			$keywords = str_replace($pattern,"",$keywords);
			
			$pname = "pname";
			foreach ($pattern as $cla){
				$pname = "REPLACE($pname,\"$cla\",\"\")";
			}
			
			$alphabet3=array ("α"=>array("alpha","&alpha;","a"),
							 "β"=>array("beta","&beta;","b"),
							 "γ"=>array("gamma","&gamma","g"),
							 "δ"=>array("delta","&delta;","d"),
							 "ε"=>array("epsilon","&epsilon;","e"),
							 "ζ"=>array("zeta","&zeta;","z"),
						     "η"=>array("eta","&eta;","η"),
							 "θ"=>array("theta","&theta;"),
							 "ι"=>array("iota","&iota;","i"),
							 "κ"=>array("kappa","&kappa;","k"),
							 "λ"=>array("lambda","&lambda;","l"),
							 "μ"=>array("mu","&mu;","m"),
						     "ν"=>array("nu","&nu;","n"),
							 "ξ"=>array("xi","&xi;","x"),
							 "ο"=>array("omicron","&omicron;","o"),
							 "π"=>array("pi","&pi;","p"),
							 "ρ"=>array("rho","&rho;","r"),
							 "ς"=>array("sigmaf","&sigmaf;"),
						     "σ"=>array("sigma","&sigma;","s"),
							 "τ"=>array("tau","&tau;","t"),
							 "υ"=>array("upsilon","&upsilon;","u"),
							 "φ"=>array("phi","&phi;"),
							 "χ"=>array("chi","&chi;"),
							 "ψ"=>array("psi","&psi;"),
						     "ω"=>array("omega","&omega;"),
							 "ϑ"=>array("thetasym","&thetasym;"),
							 "ϒ"=>array("upsih","&upsih;"),
							 "ϖ"=>array("piv","&piv;"));
			
			$condition = "";
			foreach($alphabet3 as $k => $p){
				if (strpos($keywords,$k) !== false){
					foreach($p as $v){
						$keywords1 = str_replace($k,$v,$keywords);
						$condition .= " or LOWER($pname) like '%$keywords1%' ";
					}
				}
			}
			$condition = rtrim($condition);
			echo"
				<div id='srchResultTitle'>Search Results by Product Name: <span style='color:#F00; font-size:20px; font-weight:bold; font-family:sans-serif;'>".$srchkwd."</span></div>
				  <div id='homepage_block'>
					<div id='homepage_line1'>";
					
			$dbn=array("products","prodsirna","prodlenti","prodadenovirus","prodlysates", "custom_service", "prodwesternblot", 
					   "prodpcr","prodtrans","prodothers","prodsecondanti","prodviralexp","proddnapure","prodcellimmort",
					   "prodantibiotics","prodbiochems","prodmarkers","prodihc","prodstemcell","prodprotein","prodsmallmolecule",
					   "prodipscplasmid","prod_feeder_cell","prod_growth_factor","prod_cell_culture","prodcDNAmirna",
					   "prodproteinpure","premade_mirna_exp","mirna_primers_sets","mirna_validator","prod_primary_cells",
					   "prodmirnaarray","prod_cell_lines","prodstemcellkits","prod_ipsc_cells","prodProteinVector","prodORFVector");
			
			$res_count = 0;
			
			foreach ($dbn as $val){
				switch ($val){
					case "products"://dbno=1
						$grpName = "Antibodies";
						$links = "/searches/antibodies.php?csn=8&amp;alpha=A&amp;keywords=$keywords";
						$condi = "where (LOWER(CONCAT($pname,'antibody')) like '%$keywords%') or (LOWER(CONCAT($pname,'antibodies')) like '%$keywords%')";
						break;
					case "prodsirna"://dbno=2
						$grpName = "siRNA Lentiviruses";
						$links = "/searches/siRNALentivirus.php?csn=9&amp;alpha=A&amp;keywords=$keywords3";
						$condi = "where (LOWER(CONCAT($pname,'sirna')) like '%$keywords3%') or (LOWER(CONCAT($pname,'shrna')) like '%$keywords3%') or (LOWER(CONCAT($pname,'rnai')) like '%$keywords3%')";
						break;
					case "prodlenti"://dbno=3
						$grpName = "Lentiviral Vectors";
						$links = "/searches/premadeLentivirus.php?csn=10&amp;alpha=A&amp;keywords=$keywords3";
						$condi = "where ((LOWER(CONCAT($pname,'lentivirus')) like '%$keywords3%') or (LOWER(CONCAT($pname,'lentiviral')) like '%$keywords3%')) and catNo not like 'LV010154' and catNo not like 'LV010158'";
						break;
					case "prodadenovirus"://dbno=4
						$grpName = "Premade Adenoviruses";
						$links = "/searches/premadeAdenovirus.php?csn=11&amp;alpha=A&amp;keywords=$keywords3";
						$condi = "where ((LOWER(CONCAT($pname,'adenovirus')) like '%".$keywords3."%') or (LOWER(CONCAT($pname,'adenoviruses')) like '%".$keywords3."%')) and catNo not like '000010A' and catNo not like '000134A' and catNo not like '000191A' and catNo not like '000192A' and catNo not like '000193A' and catNo not like '000196A' and catNo not like '000201A' and catNo not like '000204A' and catNo not like '000521A' and catNo not like '000701A'";
						break;
					case "prodpcr"://dbno=5
						$grpName = "PCR, RT-PCR & qPCR";
						$links = "/searches/allPCR.php?csn=12&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prodtrans"://dbno=6
						$grpName = "Transfection Reagents";
						$links = "/searches/TransfectionReagent.php?csn=13&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prodviralexp"://dbno=7
						$grpName = "Viral Expression";
						$links = "/searches/ViralExpression.php?csn=14&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prodsecondanti"://dbno=8
						$grpName = "Secondary Antibodies";
						$links = "/searches/allSecondAb.php?csn=19&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					/*case "prodrna"://dbno=9
						$grpName = "Custom iLenti siRNA";
						$links = "/searches/siRNA.php?csn=16&amp;ssn=3710&amp;keywords=$keywords";
						$condi = "where LOWER(pname) like '%$keywords%'";
						break;*/
					case "prodmarkers"://dbno=10======================
						$grpName = "DNA/Protein Marker";
						$links = "/searches/Markers.php?csn=21&amp;ssn=11255&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prodwesternblot"://dbno=11======================
						$grpName = "Western Blot";
						$links = "/searches/WesternBlot.php?csn=21&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prodlysates"://dbno=12======================
						$grpName = "Cell Lysate";
						$links = "/searches/CellLysate.php?csn=23&amp;keywords=$keywords3";
						$condi = "where (LOWER(CONCAT($pname,'lysate')) like '%$keywords3%') or (LOWER(CONCAT($pname,'lysates')) like '%$keywords3%') or (LOWER(CONCAT($pname,'celllysate')) like '%$keywords3%') or (LOWER(CONCAT($pname,'celllysates')) like '%$keywords3%')";
						break;
					case "prodcellimmort"://dbno=13======================
						$grpName = "Cell Immortalization";
						$links = "/searches/CellImmortalization.php?csn=15&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "proddnapure"://dbno=14======================
						$grpName = "DNA Purification";
						$links = "/searches/DNAPurification.php?csn=20&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "custom_service"://dbno=15======================
						$grpName = "Custom Services";
						$links = "/searches/CustomServices.php?csn=25&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%' and LOWER($pname) not like '%tet%'";
						break;
					case "prodbiochems"://dbno=16======================
						$grpName = "Chemicals";
						$links = "/searches/Chemicals.php?csn=22&amp;ssn=3919&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prodantibiotics"://dbno=17======================
						$grpName = "Antibiotics";
						$links = "/searches/Antibiotics.php?csn=22&amp;ssn=3920&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prodihc"://dbno=18
						$grpName = "Immortalized Primary Cells";
						$links = "/searches/ihcCells.php?csn=29&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prodcDNAmirna"://dbno=19======================
						$grpName = "miRNA cDNA Synthesis Kit";
						$links = "/searches/miRNAcDNASynthesisKit.php?csn=26&amp;ssn=11839&amp;dsn=12257&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "premade_mirna_exp"://dbno=26
						$grpName = "miRNA Expression Vectors";
						$links = "/searches/PremademiRNAexp.php?csn=26&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%' and LOWER($pname) not like '%tet%'";
						break;
					case "mirna_validator"://dbno=27
						$grpName = "3'UTR Lenti-reporters";
						$links = "/searches/miRNA_validator.php?csn=26&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%' and price!=10000.00";
						break;
					case "mirna_primers_sets"://dbno=28
						$grpName = "Individual miRNA Primer Sets";
						$links = "/searches/miRNAprimer.php?csn=26&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prodmirnaarray"://dbno=29
						$grpName = "qPCR miRNA Profiling Kits";
						$links = "/searches/miRNAarray.php?csn=26&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prod_cell_culture"://dbno=30
						$grpName = "Stem Cell Culture";
						$links = "/searches/CellCulture.php?csn=30&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prodstemcell"://dbno=31
						$grpName = "iPSC Lentiviruses";
						$links = "/searches/StemCellLentivirus.php?csn=30&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%' and LOWER($pname) not like 'tet%'";
						break;
					case "prodprotein"://dbno=32
						$grpName = "Recombinant Proteins";
						$links = "/searches/iPSC-RP.php?csn=55&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prodipscplasmid"://dbno=33
						$grpName = "iPSC Plasmids";
						$links = "/searches/iPSC-Plasmid.php?csn=30&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prodsmallmolecule"://dbno=34
						$grpName = "iPSC Small Molecules";
						$links = "/searches/iPSC-SM.php?csn=30&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prod_feeder_cell"://dbno=35
						$grpName = "Feeder Cells";
						$links = "/searches/StemCellFeederCell.php?csn=30&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prod_growth_factor"://dbno=36
						$grpName = "iPSC Growth Factors";
						$links = "/searches/iPSC-GF.php?csn=30&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prodstemcellkits"://dbno=37
						$grpName = "iPSC Characterization Kits";
						$links = "/searches/iPSC-characterKits.php?csn=30&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prod_ipsc_cells"://dbno=38
						$grpName = "iPSCs";
						$links = "/searches/iPSCs.php?csn=30&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prod_primary_cells"://dbno=43
						$grpName = "Primary Cells";
						$links = "/searches/PrimaryCells.php?csn=43&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prodproteinpure"://dbno=44=========================
						$grpName = "Protein Purification";
						$links = "/searches/ProteinPurification.php?csn=44&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prod_cell_lines"://dbno=45=========================
						$grpName = "Stable Cell Line";
						$links = "/searches/StableCellLine.php?csn=45&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "prod_stable_cells"://dbno=46=========================
						$grpName = "3'UTR Stable Cell Line";
						$links = "/searches/3UTRStableCellLine.php?csn=26&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like \"%$keywords3%\"";
						break;
					case "prodProteinVector"://dbno=53=========================
						$grpName = "Protein Vectors";
						$links = "/searches/premadeProteinVectors.php?csn=53&amp;keywords=$keywords3";
						$condi = "where (LOWER(CONCAT($pname,'proteinvector')) like '%$keywords3%') or (LOWER(CONCAT($pname,'proteinvectors')) like '%$keywords3%')";
						break;
					case "prodORFVector"://dbno=54=========================
						$grpName = "ORF cDNA Vectors";
						$links = "/searches/premadeORFVectors.php?csn=54&amp;keywords=$keywords3";
						$condi = "where (LOWER(CONCAT($pname,'orfvector')) like '%$keywords3%') or (LOWER(CONCAT($pname,'orfvectors')) like '%$keywords3%') or (LOWER(CONCAT($pname,'orfcdnavector')) like '%$keywords3%') or (LOWER(CONCAT($pname,'orfcdnavectors')) like '%$keywords3%')";
						break;
					case "prodothers"://dbno=99
						$grpName = "Other Products";
						$links = "/searches/OtherProds.php?csn=14&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
					case "OldOroducts"://dbno=999======================
						$grpName = "Products in Old Database";
						$links = "/searches/OldProducts.php?csn=999&amp;keywords=$keywords3";
						$condi = "where LOWER($pname) like '%$keywords3%'";
						break;
				}
				
				if($val == 'products'){
					$condi = $condi.$condition;
					$srch = "select * from `$val` $condi"; 
				}else{
					$srch = "select * from `$val` $condi"; 
				}
				$srchRes = mysql_query($srch,$db);
				$srchrows = mysql_num_rows ($srchRes);
				if ($srchrows == 0){
					continue;
				}elseif ($srchrows == 1){
					$res_count ++;
					$alink = "<a href='$links'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>match</span>";
				}elseif ($srchrows > 0){
					$res_count ++;
					$alink = "<a href='$links'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>matches</span>";
				}
				
				$srch_r = mysql_fetch_array($srchRes);
				echo "
					<div style='background-color:#e69e50;float:left; display:inline;'>
					  <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
						<div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>$grpName</div>
						<div style='padding-top:15px; height:55px; margin:5px 10px 5px 5px; font-size:40px; color:#00f; text-align:center; line-height:50px;'>$alink</div>
					  </div>
					</div>
				";
			}
			
			if ($res_count == 0){
				echo "
					<div style='background-color:#e69e50;float:left; display:inline;'>
					  <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
						<div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>No matched products found.</div>
					  </div>
					</div>
				";
			}
			
			echo "
				  </div>
				</div>
			";
			break;
		case '2' ://search by Gene Symbol
			echo "<script language=javascript>document.getElementById('srchby').selectedIndex=1;</script>";
			$keywords = strtolower($keywords);
			$alphabet1=array ('α'=>'alpha','β'=>'beta','γ'=>'gamma','δ'=>'delta','ε'=>'epsilon','ζ'=>'zeta',
							 'η'=>'eta','θ'=>'theta','ι'=>'iota','κ'=>'kappa','λ'=>'lambda','μ'=>'mu',
							 'ν'=>'nu','ξ'=>'xi','ο'=>'omicron','π'=>'pi','ρ'=>'rho','ς'=>'sigmaf','σ'=>'sigma',
							 'τ'=>'tau','υ'=>'upsilon','φ'=>'phi','χ'=>'chi','ψ'=>'psi','ω'=>'omega','ϑ'=>'thetasym',
							 'ϒ'=>'upsih','ϖ'=>'piv');
			$alphabet2=array ('α'=>'a','β'=>'b','γ'=>'g','δ'=>'d','ε'=>'e','ζ'=>'z','ι'=>'i',
							 'κ'=>'k','λ'=>'l','μ'=>'m','ν'=>'n','ξ'=>'x','ο'=>'o','π'=>'p','ρ'=>'r','σ'=>'s','τ'=>'t',
							 'υ'=>'u');
			
			foreach ($alphabet1 as $k => $p){
				$pos =array("$p ","$p-"," $p","-$p","-$p-"," $p ","-$p "," $p-");
				foreach ($pos as $m){
					if (substr($keywords,0,strlen($m)) == $m){
						$keywords = "$k".substr($keywords,strlen($m));
					}elseif(substr($keywords,-1,strlen($m)) == $m){
						$keywords = substr($keywords,0,strlen($keywords)-strlen($m))."$k";
					}elseif(strpos($keywords,$p) !== false){
						$keywords = str_replace($p,$k,$keywords);
					}else{
						$keywords = str_replace($m,$k,$keywords);
					}
				}
			}
			
			//for non antibody products.
			$pattern = array("-","/"," ",".","(",")",",",":","+");
			$keywords3 = str_replace($pattern,"",$keywords);
			foreach($alphabet2 as $k => $p){
				$keywords3 = str_replace($k,$p,$keywords3);
			}
			
			foreach ($alphabet2 as $k => $p){
				$pos =array("$p ","$p-"," $p","-$p","-$p-"," $p ","-$p "," $p-");
				foreach ($pos as $m){
					if (substr($keywords,0,strlen($m)) == $m){
						$keywords = "$k".substr($keywords,strlen($m));
					}elseif(substr($keywords,-1,strlen($m)) == $m){
						$keywords = substr($keywords,0,strlen($keywords)-strlen($m))."$k";
					}else{
						$keywords = str_replace($m,$k,$keywords);
					}
				}
			}
			$pattern = array("-","/"," ",".","(",")",",",":","+");
			$keywords = str_replace($pattern,"",$keywords);
			$claus = "sname";
			foreach ($pattern as $cla){
				$claus = "REPLACE($claus,\"$cla\",\"\")";
			}
			
			$alphabet3=array ("α"=>array("alpha","&alpha;","a"),
							 "β"=>array("beta","&beta;","b"),
							 "γ"=>array("gamma","&gamma","g"),
							 "δ"=>array("delta","&delta;","d"),
							 "ε"=>array("epsilon","&epsilon;","e"),
							 "ζ"=>array("zeta","&zeta;","z"),
						     "η"=>array("eta","&eta;","η"),
							 "θ"=>array("theta","&theta;"),
							 "ι"=>array("iota","&iota;","i"),
							 "κ"=>array("kappa","&kappa;","k"),
							 "λ"=>array("lambda","&lambda;","l"),
							 "μ"=>array("mu","&mu;","m"),
						     "ν"=>array("nu","&nu;","n"),
							 "ξ"=>array("xi","&xi;","x"),
							 "ο"=>array("omicron","&omicron;","o"),
							 "π"=>array("pi","&pi;","p"),
							 "ρ"=>array("rho","&rho;","r"),
							 "ς"=>array("sigmaf","&sigmaf;"),
						     "σ"=>array("sigma","&sigma;","s"),
							 "τ"=>array("tau","&tau;","t"),
							 "υ"=>array("upsilon","&upsilon;","u"),
							 "φ"=>array("phi","&phi;"),
							 "χ"=>array("chi","&chi;"),
							 "ψ"=>array("psi","&psi;"),
						     "ω"=>array("omega","&omega;"),
							 "ϑ"=>array("thetasym","&thetasym;"),
							 "ϒ"=>array("upsih","&upsih;"),
							 "ϖ"=>array("piv","&piv;"));
			
			$condition = "(REPLACE(LOWER(sname), '-', '') like '%$keywords%'";
			foreach($alphabet3 as $k => $p){
				if (strpos($keywords,$k) !== false){
					foreach($p as $v){
						$keywords1 = str_replace($k,$v,$keywords);
						$condition .= " or REPLACE(LOWER(sname), '-', '') like '%$keywords1%'";
					}
				}
			}
			$condition = $condition.")";

			$srch="select * from category where cname='Genes'";
			$srchres=mysql_query($srch,$db);
			$srchrw=mysql_num_rows($srchres);
			if ($srchrw>0){
				$sr=mysql_fetch_array($srchres);
				$csn=$sr['sn'];
				
				$subs="select * from subcat where csn='$csn' and $condition order by sname";
				$subres=mysql_query($subs,$db);
				$subrw=mysql_num_rows($subres);
				if ($subrw>0){
					echo"
						<div id='srchResultTitle'>Search Results for Gene: <span style='color:#F00; font-weight:bold; font-family:Arial, Helvetica, sans-serif;'>".$keywordsOrigin."</span></div>
						<div id='homepage_block'>
  							<div id='homepage_line1'>";
							
					$su = array();		
					while ($subr=mysql_fetch_array($subres)){
						$ssn=$subr['sn'];
						$sname=$subr['sname'];
						$su["$ssn"] = $sname;
					}
						
						
						$srchdb = array("products","prodsirna","prodlenti","prodadenovirus","mirna_validator","mirna_primers","mirna_expression","prodProteinVector","prodORFVector","prodlysates","prodprotein");
						foreach ($srchdb as $val){
							switch ($val){
								case "products":
									$variable = 'sn';
									$grpName = "Antibodies";
									foreach($su as $ssn => $sname){
										$links = "/Antibody/ProdList.php?csn=8&amp;ssn=$ssn";
										$condi = "where csn = 8 and ssn = $ssn";
										
										$srch = "select $variable from $val $condi"; 
										$srchRes = mysql_query($srch,$db);
										$srchrows = mysql_num_rows ($srchRes);
										if ($srchrows == 0){
											continue;
										}elseif ($srchrows == 1){
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>match</span>";
										}else{
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>matches</span>";
										}
										echo "
											<div style='background-color:#e69e50;float:left; display:inline;'>
											  <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
												<div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>$grpName<br/><span style='color:#960; font-weight:normal;'>[ $sname ]</span></div>
												<div style='padding-top:15px; height:55px; margin:5px 10px 5px 5px; font-size:40px; color:#00f; text-align:center; line-height:50px;'>$alink</div>
											  </div>
											</div>
										";
									}
									break;
								case "prodsirna":
									$variable = 'sn';
									$grpName = "siRNA Lentiviruses";
									foreach($su as $ssn => $sname){
										$links = "/premadeSiRNA/ProdList.php?csn=9&amp;ssn=$ssn";
										$condi = "where csn = 8 and ssn = $ssn";

										$srch = "select $variable from $val $condi"; 
										$srchRes = mysql_query($srch,$db);
										$srchrows = mysql_num_rows ($srchRes);
										if ($srchrows == 0){
											continue;
										}elseif ($srchrows == 1){
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>match</span>";
										}else{
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>matches</span>";
										}
										echo "
											<div style='background-color:#e69e50;float:left; display:inline;'>
											  <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
												<div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>$grpName<br/><span style='color:#960;font-weight:normal;'>[ $sname ]</span></div>
												<div style='padding-top:15px; height:55px; margin:5px 10px 5px 5px; font-size:40px; color:#00f; text-align:center; line-height:50px;'>$alink</div>
											  </div>
											</div>
										";
									}
									break;
								case "prodlenti":
									$variable = 'sn';
									$grpName = "Lentiviral Vectors";
									foreach($su as $ssn => $sname){
										$links = "/premadeLenti/ProdList.php?csn=10&amp;ssn=$ssn";
										$condi = "where csn = 8 and ssn = $ssn";
										
										$srch = "select $variable from $val $condi and catNo not like 'LV010154' and catNo not like 'LV010158'"; 
										$srchRes = mysql_query($srch,$db);
										$srchrows = mysql_num_rows ($srchRes);
										if ($srchrows == 0){
											continue;
										}elseif ($srchrows == 1){
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>match</span>";
										}else{
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>matches</span>";
										}
										echo "
											<div style='background-color:#e69e50;float:left; display:inline;'>
											  <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
												<div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>$grpName<br/><span style='color:#960;font-weight:normal;'>[ $sname ]</span></div>
												<div style='padding-top:15px; height:55px; margin:5px 10px 5px 5px; font-size:40px; color:#00f; text-align:center; line-height:50px;'>$alink</div>
											  </div>
											</div>
										";
									}
									break;
								case "prodadenovirus":
									$variable = 'sn';
									$grpName = "Premade Adenoviruses";
									foreach($su as $ssn => $sname){
										$links = "/premadeAdeno/ProdList.php?csn=11&amp;ssn=$ssn";
										$condi = "where csn = 8 and ssn = $ssn and ssn <> 3529 and ssn <> 3626";
									
										$srch = "select $variable from $val $condi and catNo not like '000010A' and catNo not like '000134A' and catNo not like '000191A' and catNo not like '000192A' and catNo not like '000193A' and catNo not like '000196A' and catNo not like '000201A' and catNo not like '000204A' and catNo not like '000521A' and catNo not like '000701A'"; 
										$srchRes = mysql_query($srch,$db);
										$srchrows = mysql_num_rows ($srchRes);
										if ($srchrows == 0){
											continue;
										}elseif ($srchrows == 1){
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>match</span>";
										}else{
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>matches</span>";
										}
										echo "
											<div style='background-color:#e69e50;float:left; display:inline;'>
											  <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
												<div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>$grpName<br/><span style='color:#960;font-weight:normal;'>[ $sname ]</span></div>
												<div style='padding-top:15px; height:55px; margin:5px 10px 5px 5px; font-size:40px; color:#00f; text-align:center; line-height:50px;'>$alink</div>
											  </div>
											</div>
										";
									}
									break;
								case "prodProteinVector":
									$variable = 'sn';
									$grpName = "Protein Vectors";
									foreach($su as $ssn => $sname){
										$links = "/premadeProteinVector/ProdList.php?csn=53&amp;ssn=$ssn";
										$condi = "where csn = 8 and ssn = $ssn";
										
										$srch = "select $variable from $val $condi"; 
										$srchRes = mysql_query($srch,$db);
										$srchrows = mysql_num_rows ($srchRes);
										if ($srchrows == 0){
											continue;
										}elseif ($srchrows == 1){
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>match</span>";
										}else{
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>matches</span>";
										}
										echo "
											<div style='background-color:#e69e50;float:left; display:inline;'>
											  <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
												<div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>$grpName<br/><span style='color:#960;font-weight:normal;'>[ $sname ]</span></div>
												<div style='padding-top:15px; height:55px; margin:5px 10px 5px 5px; font-size:40px; color:#00f; text-align:center; line-height:50px;'>$alink</div>
											  </div>
											</div>
										";
									}
									break;
								case "prodORFVector":
									$variable = 'sn';
									$grpName = "ORF Vectors";
									foreach($su as $ssn => $sname){
										$links = "/premadeORFVector/ProdList.php?csn=54&amp;ssn=$ssn";
										$condi = "where csn = 8 and ssn = $ssn";
										
										$srch = "select $variable from $val $condi"; 
										$srchRes = mysql_query($srch,$db);
										$srchrows = mysql_num_rows ($srchRes);
										if ($srchrows == 0){
											continue;
										}elseif ($srchrows == 1){
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>match</span>";
										}else{
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>matches</span>";
										}
										echo "
											<div style='background-color:#e69e50;float:left; display:inline;'>
											  <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
												<div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>$grpName<br/><span style='color:#960;font-weight:normal;'>[ $sname ]</span></div>
												<div style='padding-top:15px; height:55px; margin:5px 10px 5px 5px; font-size:40px; color:#00f; text-align:center; line-height:50px;'>$alink</div>
											  </div>
											</div>
										";
									}
									break;
								case "prodlysates":
									$variable = 'sn';
									$grpName = "Protein Lysates";
									foreach($su as $ssn => $sname){
										$links = "/premadeProteinLysate/ProdList.php?csn=56&amp;ssn=$ssn";
										$condi = "where csn = 8 and ssn = $ssn";
										
										$srch = "select $variable from $val $condi"; 
										$srchRes = mysql_query($srch,$db);
										$srchrows = mysql_num_rows ($srchRes);
										if ($srchrows == 0){
											continue;
										}elseif ($srchrows == 1){
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>match</span>";
										}else{
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>matches</span>";
										}
										echo "
											<div style='background-color:#e69e50;float:left; display:inline;'>
											  <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
												<div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>$grpName<br/><span style='color:#960;font-weight:normal;'>[ $sname ]</span></div>
												<div style='padding-top:15px; height:55px; margin:5px 10px 5px 5px; font-size:40px; color:#00f; text-align:center; line-height:50px;'>$alink</div>
											  </div>
											</div>
										";
									}
									break;
								case "prodprotein":
									$variable = 'sn';
									$grpName = "Recombinant Proteins";
									foreach($su as $ssn => $sname){
										$links = "/premadeRecombProtein/ProdList.php?csn=55&amp;ssn=$ssn";
										$condi = "where csn = 8 and ssn = $ssn";
										
										$srch = "select $variable from $val $condi"; 
										$srchRes = mysql_query($srch,$db);
										$srchrows = mysql_num_rows ($srchRes);
										if ($srchrows == 0){
											continue;
										}elseif ($srchrows == 1){
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>match</span>";
										}else{
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>matches</span>";
										}
										echo "
											<div style='background-color:#e69e50;float:left; display:inline;'>
											  <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
												<div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>$grpName<br/><span style='color:#960;font-weight:normal;'>[ $sname ]</span></div>
												<div style='padding-top:15px; height:55px; margin:5px 10px 5px 5px; font-size:40px; color:#00f; text-align:center; line-height:50px;'>$alink</div>
											  </div>
											</div>
										";
									}
									break;
								case "mirna_validator":
									$variable = 'sn';
									$grpName = "3'UTR Lenti-reporters";
										$links = "/searches/miRNA_validator.php?csn=26&ssn=11838&dsn=12288&keywords=$keywords3";
										$condi = "where LOWER(geneName) like '$keywords3' and price!=10000.00";
										
										$srch = "select $variable from $val $condi"; 
										$srchRes = mysql_query($srch,$db);
										$srchrows = mysql_num_rows ($srchRes);
										if ($srchrows == 0){
											continue;
										}elseif ($srchrows == 1){
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>match</span>";
										}else{
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>matches</span>";
										}
										echo "
											<div style='background-color:#e69e50;float:left; display:inline;'>
											  <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
												<div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>$grpName<br/><span style='color:#960;font-weight:normal;'>[ ".strtoupper($keywords3)." ]</span></div>
												<div style='padding-top:15px; height:55px; margin:5px 10px 5px 5px; font-size:40px; color:#00f; text-align:center; line-height:50px;'>$alink</div>
											  </div>
											</div>
										";
									break;
								case "mirna_primers":
									$val = 'mirna_human_genes';
									$variable = 'miRNA';
									$grpName = "miRNA Primer Sets";
										$links = "/miRNA/miRNAprimers/srch_primers_sets.php?csn=26&amp;&ssn=11839&amp;dsn=12258&amp;genename=$keywords3&amp;species=Human";
										$condi = "where LOWER(Gene_ID) like '$keywords3' group by miRNA";
										
										$srch = "select $variable from $val $condi"; 
										$srchRes = mysql_query($srch,$db);
										$srchrows = mysql_num_rows ($srchRes);
										if ($srchrows == 0){
											continue;
										}elseif ($srchrows == 1){
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>match</span>";
										}else{
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>matches</span>";
										}
										echo "
											<div style='background-color:#e69e50;float:left; display:inline;'>
											  <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
												<div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>$grpName<br/><span style='color:#960;font-weight:normal;'>[ ".strtoupper($keywords3)." ]</span></div>
												<div style='padding-top:15px; height:55px; margin:5px 10px 5px 5px; font-size:40px; color:#00f; text-align:center; line-height:50px;'>$alink</div>
											  </div>
											</div>
										";
									break;
								case "mirna_expression":
									$val = 'mirna_human_genes';
									$variable = 'miRNA';
									$grpName = "miRNA Expression";
										$links = "/miRNA/expression/srch_exp.php?csn=26&amp;&ssn=11838&amp;dsn=12251&amp;gene=$keywords3&amp;species=Human";
										$condi = "where LOWER(Gene_ID) like '$keywords3' group by miRNA";
										
										$srch = "select $variable from $val $condi"; 
										$srchRes = mysql_query($srch,$db);
										$srchrows = mysql_num_rows ($srchRes);
										if ($srchrows == 0){
											continue;
										}elseif ($srchrows == 1){
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>match</span>";
										}else{
											$alink = "<a href='$links&amp;srchby=$srchby'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>matches</span>";
										}
										echo "
											<div style='background-color:#e69e50;float:left; display:inline;'>
											  <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
												<div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>$grpName<br/><span style='color:#960;font-weight:normal;'>[ ".strtoupper($keywords3)." ]</span></div>
												<div style='padding-top:15px; height:55px; margin:5px 10px 5px 5px; font-size:40px; color:#00f; text-align:center; line-height:50px;'>$alink</div>
											  </div>
											</div>
										";
									break;
							}
						}
					echo "
						  </div>
						</div>
					";
				}else{
					echo "<div style='margin:40px 40px 40px 100px; font-size:14px;'><img src='/images/alert.jpg' height='40' width='40' />Could not find gene symbol like \"<span style='font-size:18px;color:#f00;font-weight:bold'>$srchkwd</span>\", please check <a href='http://www.genenames.org/cgi-bin/quick_search.pl' target='_blank'>Approved Gene Symbol</a></div>";
				}
			}
			break;
		case '3': //search by CatNO.
			echo "<script language=javascript>document.getElementById('srchby').selectedIndex=2;</script>";
			echo "
			  <table width='100%' border='0' cellpadding='0' cellspacing='0' class='cont-b'>
				<tr>
				  <td height='30' colspan='5'><span class='cont-y'>Search Result:</span> <span class='smal'>(By Catalogue Number)</span> </td>
				</tr>
				<tr>
			";
			
			//search PCR, RT-PCR, qPCR dbno=5
			$prd="select * from prodpcr where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/PCR/allPCR-dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/PCR/allPCR-dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
				//break;
			}
				
			//search Transfection Reagents dbno=6
			$prd="select * from prodtrans where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/Transfection/allTransfection-dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/Transfection/allTransfection-dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
				//break;
			}
				
			//search Viral Expression  and iLenti RNAi expression dbno=7
			$prd="select * from prodviralexp where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$catno=$pr['catNo'];
					$csn=14;
					$ssn=3883;
					$dsn=4018;
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='searches/ViralExpressionByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&pcat=$csn&catno=$catno&srchby=$srchby' class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='searches/ViralExpressionByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&pcat=$csn&catno=$catno&srchby=$srchby' class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
				//break;
			}
				
			//search Second Antibodies dbno=8
			$prd="select * from prodsecondanti where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/SecondAntibody/allSecondAb-dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/SecondAntibody/allSecondAb-dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
				//break;
			}
				
			//search DNA/Protein Marker dbno=10
			$prd="select * from prodmarkers where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/searches/MarkersByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/searches/MarkersByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
				//break;
			}
				
			//search Western Blot dbno=11
			$prd="select * from prodwesternblot where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/searches/WesternBlotByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/searches/WesternBlotByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
				//break;
			}
				
			//search Cell Lysate dbno=12
			$prd="select * from prodlysates where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$csn=$pr['csn'];
					if($csn==8){$csn=56;}
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/searches/CellLysateByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/searches/CellLysateByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
				//break;
			}
				
			//search Cell Immortalization dbno=13
			$prd="select * from prodcellimmort where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/searches/CellImmortalizationByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/searches/CellImmortalizationByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
				//break;
			}
				
			//search DNA Purification dbno=14
			$prd="select * from proddnapure where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/searches/DNAPurificationByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/searches/DNAPurificationByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
				//break;
			}
				
			//search Custom Services dbno=15
			$prd="select * from custom_service where catNo like '$keywords%' and LOWER(pname) not like '%tet%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/searches/CustomServicesByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/searches/CustomServicesByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
				//break;
			}
				
			//search Chemicals dbno=16
			$prd="select * from prodbiochems where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/searches/ChemicalsByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/searches/ChemicalsByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
				//break;
			}
				
			//search Antibiotics dbno=17
			$prd="select * from prodantibiotics where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/searches/AntibioticsByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/searches/AntibioticsByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
				
			//search Immortalized Primary Cells dbno=18
			$prd="select * from prodihc where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$sn=$pr['sn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/IHC/ihcCells-dispOne.php?sn=$sn&csn=$csn&ssn=$ssn&dsn=$dsn&catanumber=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/IHC/ihcCells-dispOne.php?sn=$sn&csn=$csn&ssn=$ssn&dsn=$dsn&catanumber=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
				//break;
			}
				
			//search miRNA cDNA Synthesis Kit dbno=19
			$sql="select * from `prodcDNAmirna` where catNo like '$keywords%' order by catNo";
			$result=mysql_query($sql,$db);
			$row=mysql_num_rows($result);
			if ($row>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($result)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=miRNA/miRNAcDNASyn.php?csn=26&ssn=11839&dsn=12257&catno=G269 class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=miRNA/miRNAcDNASyn.php?csn=26&ssn=11839&dsn=12257&catno=G269 class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search miRNA Expression Vectors dbno=26
			$sql="select * from `premade_mirna_exp` where catNo like '$keywords%' and LOWER(pname) not like '%tet%' order by catNo";
			$result=mysql_query($sql,$db);
			$row=mysql_num_rows($result);
			if ($row>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($result)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/miRNA/expression/dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catanumber=$catno class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/miRNA/expression/dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catanumber=$catno class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search miRNA 3'UTR Lenti-Reporter Vectors dbno=27
			$sql="select * from mirna_validator where catNo like '$keywords%' order by catNo";
			$result=mysql_query($sql,$db);
			$row=mysql_num_rows($result);
			if ($row>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($result)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					$genename = $pr['geneName'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/3'UTR-Reporter-$catno.html class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/3'UTR-Reporter-$catno.html class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search miRNA 3'UTR Lenti-Reporter Vectors dbno=27
			$sql="select * from prod_stable_cells where catNo like '$keywords%' order by catNo";
			$result=mysql_query($sql,$db);
			$row=mysql_num_rows($result);
			if ($row>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($result)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					$genename = $pr['geneName'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/miRNA/targetvalid-dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&report=stable class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/miRNA/targetvalid-dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&report=stable class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search Individual miRNA Primers Sets dbno=28
			$sql="select * from mirna_primers_sets where catNo like '$keywords%' order by catNo";
			$result=mysql_query($sql,$db);
			$row=mysql_num_rows($result);
			if ($row>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($result)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/miRNA/miRNAprimers/dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catanumber=$catno class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/miRNA/miRNAprimers/dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catanumber=$catno class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search qPCR miRNA Profiling Kits dbno=29
			$sql="select * from prodmirnaarray where catNo like '$keywords%' order by catNo";
			$result=mysql_query($sql,$db);
			$row=mysql_num_rows($result);
			if ($row>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($result)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						switch ($catno){
							case "MA003":
								echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Human-Whole-Genome-miRNA-Profiling-Kit.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA001":
								echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Human-miReveal-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA006":
								echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Human-Cancer-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA016":
								echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Human-Stem-Cell-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA008":
								echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Human-Inflammation-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA010":
								echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Human-Cell-Division-and-Development-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA014":
								echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Human-Immunopathology-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA004":
								echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Mouse-Whole-Genome-miRNA-Profiling-Kit.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA002":
								echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Mouse-miReveal-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA007":
								echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Mouse-Cancer-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA017":
								echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Mouse-Stem-Cell-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA009":
								echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Mouse-Inflammation-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA011":
								echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Mouse-Cell-Division-and-Development-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA015":
								echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Mouse-Immunopathology-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
						}
					}elseif ($j<=$prw){
						$i=1;
						switch ($catno){
							case "MA003":
								echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Human-Whole-Genome-miRNA-Profiling-Kit.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA001":
								echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Human-miReveal-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA006":
								echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Human-Cancer-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA016":
								echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Human-Stem-Cell-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA008":
								echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Human-Inflammation-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA010":
								echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Human-Cell-Division-and-Development-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA014":
								echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Human-Immunopathology-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA004":
								echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Mouse-Whole-Genome-miRNA-Profiling-Kit.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA002":
								echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Mouse-miReveal-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA007":
								echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Mouse-Cancer-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA017":
								echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Mouse-Stem-Cell-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA009":
								echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Mouse-Inflammation-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA011":
								echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Mouse-Cell-Division-and-Development-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
							case "MA015":
								echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/Mouse-Immunopathology-miRNA-Array.html' class='cat_link'>$catno</a></td>";
								break;
						}
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search Stem Cell Culture dbno=30
			$sql="select * from prod_cell_culture where catNo like '$keywords%' order by catNo";
			$result=mysql_query($sql,$db);
			$row=mysql_num_rows($result);
			if ($row>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($result)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						if (strtolower($catno) == 'g238'){
							echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-MycoKit.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
						}elseif (strtolower($catno) == 'g287'){
							echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-Luciferase.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
						}elseif (strtolower($catno) == 'g398'){
							echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/Mycoplasma-Elimination-Cocktail-G398.html class='cat_link'>$catno</a></td>";
						}elseif (strtolower($catno) == 'g285'){
							echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/BacAway-Antibiotic-Mix-G285.html class='cat_link'>$catno</a></td>";
						}elseif (strtolower($catno) == 'g422'){
							echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/Applied-Cell-Extracellular-Matrix-G422.html class='cat_link'>$catno</a></td>";
						}else{
							echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-CellCulture.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
						}
					}elseif ($j<=$prw){
						$i=1;
						if (strtolower($catno) == 'g238'){
							echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-MycoKit.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
						}elseif (strtolower($catno) == 'g287'){
							echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-Luciferase.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
						}elseif (strtolower($catno) == 'g422'){
							echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/Applied-Cell-Extracellular-Matrix-G422.html class='cat_link'>$catno</a></td>";
						}else{
							echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-CellCulture.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
						}
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search iPSC Lentivirus dbno=31
			$sql="select * from prodstemcell where catNo like '$keywords%' and LOWER(pname) not like 'tet%' order by catNo";
			$result=mysql_query($sql,$db);
			$row=mysql_num_rows($result);
			if ($row>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($result)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-StemCell.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-StemCell.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search iPSC Recombinant Proteins dbno=32
			$sql="select * from prodprotein where catNo like '$keywords%' order by catNo";
			$result=mysql_query($sql,$db);
			$row=mysql_num_rows($result);
			if ($row>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($result)){
					$csn=$pr['csn'];
					if($csn==8){$csn=55;}
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/premadeRecombProtein/premadeRecombProtein-dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/premadeRecombProtein/premadeRecombProtein-dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search iPSC Plasmids dbno=33
			$sql="select * from prodipscplasmid where catNo like '$keywords%' order by catNo";
			$result=mysql_query($sql,$db);
			$row=mysql_num_rows($result);
			if ($row>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($result)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-StemCell.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-StemCell.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search iPSC Small Molecules dbno=34
			$sql="select * from prodsmallmolecule where catNo like '$keywords%' order by catNo";
			$result=mysql_query($sql,$db);
			$row=mysql_num_rows($result);
			if ($row>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($result)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-StemCell.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-StemCell.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search iPSC Feeder cell dbno=35
			$sql="select * from prod_feeder_cell where catNo like '$keywords%' order by catNo";
			$result=mysql_query($sql,$db);
			$row=mysql_num_rows($result);
			if ($row>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($result)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-StemCell.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-StemCell.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search iPSC Growth Factors dbno=36
			$sql="select * from prod_growth_factor where catNo like '$keywords%' order by catNo";
			$result=mysql_query($sql,$db);
			$row=mysql_num_rows($result);
			if ($row>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($result)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-GrowthFactors.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-GrowthFactors.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search iPSC iPSCs
			$sql="select * from prod_ipsc_cells where catNo like '$keywords%' order by catNo";
			$result=mysql_query($sql,$db);
			$row=mysql_num_rows($result);
			if ($row>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($result)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-StemCell.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-StemCell.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search iPSC Char. Kits
			$sql="select * from prodstemcellkits where catNo like '$keywords%' order by catNo";
			$result=mysql_query($sql,$db);
			$row=mysql_num_rows($result);
			if ($row>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($result)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-CharKit.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/StemCell/dispOne-CharKit.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search Primary Cells dbno=43
			$prd="select * from prod_primary_cells where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$sn=$pr['sn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/PrimaryCells/primaryCells-dispOne.php?sn=$sn&csn=$csn&ssn=$ssn&dsn=$dsn&catanumber=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/PrimaryCells/primaryCells-dispOne.php?sn=$sn&csn=$csn&ssn=$ssn&dsn=$dsn&catanumber=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search Protein Purification dbno=44
			$prd="select * from prodproteinpure where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$sn=$pr['sn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=searches/ProteinPurification.php?sn=$sn&csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=searches/ProteinPurification.php??sn=$sn&csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search Stable Cell Line dbno=45
			$prd="select * from prod_cell_lines where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$sn=$pr['sn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/StableCellLines/cellLine-dispOne.php?csn=45&catno=$catno' class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='/StableCellLines/cellLine-dispOne.php?csn=45&catno=$catno' class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search Protein Vectors dbno=53
			$sql="select * from prodProteinVector where catNo like '$keywords%' order by catNo";
			$result=mysql_query($sql,$db);
			$row=mysql_num_rows($result);
			if ($row>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($result)){
					$csn=$pr['csn'];
					if($csn==8){$csn=53;}
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/premadeProteinVector/premadeProteinVector-dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/premadeProteinVector/premadeProteinVector-dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search Protein Vectors dbno=54
			$sql="select * from prodORFVector where catNo like '$keywords%' order by catNo";
			$result=mysql_query($sql,$db);
			$row=mysql_num_rows($result);
			if ($row>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($result)){
					$csn=$pr['csn'];
					if($csn==8){$csn=54;}
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/premadeORFVector/premadeORFVector-dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/premadeORFVector/premadeORFVector-dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catno=$catno class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
			
			//search Other products dbno=99
			$prd="select * from prodothers where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$catno=$pr['catNo'];
					$csn=14;
					$ssn=3883;
					$dsn=4018;
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='searches/OtherProdsByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&pcat=$csn&catno=$catno&srchby=$srchby' class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href='searches/OtherProdsByCatNo.php?csn=$csn&ssn=$ssn&dsn=$dsn&pcat=$csn&catno=$catno&srchby=$srchby' class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
			}
				
			//search Antibodies dbno=1
			$prd="select * from products where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$csn=$pr['csn'];
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/Antibody/antibody-dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catanumber=$catno class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/Antibody/antibody-dispOne.php?csn=$csn&ssn=$ssn&dsn=$dsn&catanumber=$catno class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
				//break;
			}
				
			//search siRNA Lentivirus dbno=2
			$prd="select * from prodsirna where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/premadeSiRNA/premadeSiRNA-dispOne.php?csn=9&ssn=$ssn&dsn=$dsn&catanumber=$catno class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/premadeSiRNA/premadeSiRNA-dispOne.php?csn=9&ssn=$ssn&dsn=$dsn&catanumber=$catno class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
				//break;
			}
			
			//search Pre-Made Lentivirus dbno=3
			$prd="select * from prodlenti where catNo like '$keywords%' and catNo not like 'LV010154' and catNo not like 'LV010158' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/premadeLenti/premadeLenti-dispOne.php?csn=10&ssn=$ssn&dsn=$dsn&catanumber=$catno class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/premadeLenti/premadeLenti-dispOne.php?csn=10&ssn=$ssn&dsn=$dsn&ccatanumber=$catno class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
				//break;
			}
				
			
			//search Pre-Made Adenovirus dbno=4
			$prd="select * from prodadenovirus where catNo like '$keywords%' and catNo not like '000010A' and catNo not like '000134A' and catNo not like '000191A' and catNo not like '000192A' and catNo not like '000193A' and catNo not like '000196A' and catNo not like '000201A' and catNo not like '000204A' and catNo not like '000521A' and catNo not like '000701A' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$ssn=$pr['ssn'];
					$dsn=$pr['dsn'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/premadeAdeno/premadeAdeno-dispOne.php?csn=11&ssn=$ssn&dsn=$dsn&catanumber=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/premadeAdeno/premadeAdeno-dispOne.php?csn=11&ssn=$ssn&dsn=$dsn&catanumber=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
				//break;
			}
			
			//search old database for old products. dbno=999
			include ("includes/connabm.php");
			$prd="select * from products where catNo like '$keywords%' order by catNo";
			$prdres=mysql_query($prd,$db);
			$prw=mysql_num_rows($prdres);
			if ($prw>0){
				$i=1; $j=1;
				while ($pr=mysql_fetch_array($prdres)){
					$csn=$pr['gno'];
					$ssn=$pr['subno'];
					$dsn=$pr['chdno'];
					$catno=$pr['catNo'];
					if ($i<=5){
						echo "<td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/TagAntibody/dispOne.php?csn=17&ssn=$ssn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}elseif ($j<=$prw){
						$i=1;
						echo "</tr><tr><td height=25 style='font-size:14px;'>&#8226;&nbsp;&nbsp;<a href=/TagAntibody/dispOne.php?csn=17&ssn=$ssn&catno=$catno&srchby=$srchby class='cat_link'>$catno</a></td>";
					}
					$i++; $j++;
				}
				for ($m=1;$m<=(5-$i);$m++){
					echo "<td>&nbsp;</td>";
				}
				echo "</tr>";
			//	break;
				
			}
			
			echo "</table>";
			break;
                // search by Accession Number
		case "4": 
                        //remove space, uderscore and dash.
                        $keywords = strtoupper($keywords);
                        $keywords = str_replace(" ","",$keywords);
                        $keywords = str_replace("-","",$keywords);
                        $keywords = str_replace("_","",$keywords);
                        //according to user input, there are three keyword categories.
                        $keywordCategory = 0;
                        //first two characters equals GI
                        if(strncmp($keywords, 'GI', 2)==0)
                        {
                            $keywords= str_replace("GI", "GI:", $keywords);
                            $keywordCategory = 1;
                        //first two characters equals BC
                        }elseif (strncmp($keywords, 'BC', 2)==0) {
                            $keywordCategory = 2;
                        //keyword is numeric
                        }elseif (is_numeric($keywords)) {
                            $keywordCategory = 3;
                        }
                        //any other user input.(NM, XM etc)
                        else
                        {
                            $letterword = substr($keywords, 0, 2);
                            $keywords=  str_replace($letterword, $letterword.'_', $keywords);
                            $keywordCategory = 2;
                        }
                        echo"
                            <div id='srchResultTitle'>Search Results by Accession Number: <span style='color:#F00; font-size:20px; font-weight:bold; font-family:sans-serif;'>".$srchkwd."</span></div>
                              <div id='homepage_block'>
                                    <div id='homepage_line1'>";
                        //Search from database
                        switch($keywordCategory) {
                            //when user input GI, only search for alternative accession number in prodlenti and prodadenovirus table.
                            case 1:
                                $res_count = 0;
                                $srchdb = array("prodlenti","prodadenovirus");
                                foreach ($srchdb as $val){
                                    switch ($val){
                                        case "prodlenti":
                                            $grpName = "Lentiviral Vectors";
                                            $links = "/searchByAccessionNo/premadeLentivirus.php?keywords=$keywords";
                                            $condi = "WHERE AlternativeAccession LIKE '%$keywords%'";
                                            break;
                                        case "prodadenovirus"://dbno=4
                                            $grpName = "Premade Adenoviruses";
                                            $links = "/searchByAccessionNo/premadeAdenovirus.php?keywords=$keywords";
                                            $condi = "WHERE OtherAccession LIKE '%$keywords%'";
                                            break;
                                    }
                                    $srch = "select sn from `$val` $condi"; 
                                    $srchRes = mysql_query($srch,$db);
                                    //find how many rows of the query
                                    $srchrows = mysql_num_rows ($srchRes);
                                    /*$srch = "select count(sn) AS NumberOfQuery from `$val` $condi"; 
                                    $srchRes = mysql_query($srch,$db);
                                    $srch_r = mysql_fetch_array($srchRes);
                                    $srchrows = $srch_r['NumberOfQuery'];*/
                                    if ($srchrows == 0){
                                            continue;
                                    }elseif ($srchrows == 1){
                                            $res_count ++;
                                            $alink = "<a href='$links'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>match</span>";
                                    }elseif ($srchrows > 0){
                                            $res_count ++;
                                            $alink = "<a href='$links'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>matches</span>";
                                    }

                                    
                                    echo "
                                            <div style='background-color:#e69e50;float:left; display:inline;'>
                                              <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
                                                    <div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>$grpName</div>
                                                    <div style='padding-top:15px; height:55px; margin:5px 10px 5px 5px; font-size:40px; color:#00f; text-align:center; line-height:50px;'>$alink</div>
                                              </div>
                                            </div>
                                    ";
                                    }
                                    //nothing found
                                    if ($res_count == 0){
                                            echo "
                                                    <div style='background-color:#e69e50;float:left; display:inline;'>
                                                      <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
                                                            <div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>No matched products found.</div>
                                                      </div>
                                                    </div>
                                            ";
                                    }

                                    echo "
                                            </div>
                                        </div>";
                                break;
                            //when user search for BC, XM, NM etc.
                            case 2:
                                $res_count = 0;
                                //search keywords in 7 databases.
                                $srchdb = array("prodsirna","prodlenti","prodadenovirus","prodProteinVector","prodORFVector","prodprotein","prodlysates");
                                foreach ($srchdb as $val){
                                    switch ($val){
                                        case "prodsirna":
                                            $grpName = "siRNA Lentiviruses";
                                            $links = "/searchByAccessionNo/siRNALentivirus.php?keywords=$keywords";
                                            $condi = "WHERE AccessionNumber LIKE '$keywords%' OR AccessionNumber LIKE '$keywords.%'";
                                            break;
                                        case "prodlenti":
                                            $grpName = "Lentiviral Vectors";
                                            $links = "/searchByAccessionNo/premadeLentivirus.php?keywords=$keywords";
                                            $condi = "WHERE AccessionNumber LIKE '$keywords%' OR AccessionNumber LIKE '$keywords.%' OR AlternativeAccession REGEXP '^.*$keywords"."[^0-9].*' OR AlternativeAccession REGEXP '^.*$keywords\..*$' OR AlternativeAccession = '$keywords'";
                                            break;
                                        case "prodadenovirus"://dbno=4
                                            $grpName = "Premade Adenoviruses";
                                            $links = "/searchByAccessionNo/premadeAdenovirus.php?keywords=$keywords";
                                            $condi = "WHERE AccessionNumber LIKE '$keywords%' OR AccessionNumber LIKE '$keywords.%' OR OtherAccession REGEXP '^.*$keywords"."[^0-9].*' OR OtherAccession REGEXP '^.*$keywords\..*$' OR OtherAccession = '$keywords'";
                                            break;
                                        case "prodProteinVector"://dbno=53=========================
                                            $grpName = "Protein Vectors";
                                            $links = "/searchByAccessionNo/premadeProteinVectors.php?keywords=$keywords";
                                            $condi = "WHERE AccessionNumber LIKE '$keywords%' OR AccessionNumber LIKE '$keywords.%'";
                                            break;
                                        case "prodORFVector"://dbno=54=========================
                                            $grpName = "ORF cDNA Vectors";
                                            $links = "/searchByAccessionNo/premadeORFVectors.php?keywords=$keywords";
                                            $condi = "WHERE AccessionNumber LIKE '$keywords%' OR AccessionNumber LIKE '$keywords.%'";
                                            break;
                                        case "prodprotein"://dbno=32
                                            $grpName = "Recombinant Proteins";
                                            $links = "/searchByAccessionNo/iPSC-RP.php?keywords=$keywords";
                                            $condi = "WHERE AccessionNumber LIKE '$keywords%' OR AccessionNumber LIKE '$keywords.%'";
                                            break;
                                        case "prodlysates"://dbno=12======================
                                            $grpName = "Cell Lysate";
                                            $links = "/searchByAccessionNo/CellLysate.php?keywords=$keywords";
                                            $condi = "WHERE accessionNo LIKE '$keywords%' OR accessionNo LIKE '$keywords.%'";
                                            break;


                                    }
                                    $srch = "select sn from `$val` $condi"; 
                                    $srchRes = mysql_query($srch,$db);
                                    $srchrows = mysql_num_rows ($srchRes);
                                    /*$srch = "select count(sn) AS NumberOfQuery from `$val` $condi"; 
                                    $srchRes = mysql_query($srch,$db);
                                    $srch_r = mysql_fetch_array($srchRes);
                                    $srchrows = $srch_r['NumberOfQuery'];*/
                                    if ($srchrows == 0){
                                            continue;
                                    }elseif ($srchrows == 1){
                                            $res_count ++;
                                            $alink = "<a href='$links'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>match</span>";
                                    }elseif ($srchrows > 0){
                                            $res_count ++;
                                            $alink = "<a href='$links'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>matches</span>";
                                    }

                                    //$srch_r = mysql_fetch_array($srchRes);
                                    echo "
                                            <div style='background-color:#e69e50;float:left; display:inline;'>
                                              <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
                                                    <div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>$grpName</div>
                                                    <div style='padding-top:15px; height:55px; margin:5px 10px 5px 5px; font-size:40px; color:#00f; text-align:center; line-height:50px;'>$alink</div>
                                              </div>
                                            </div>
                                    ";
                                    }
                                    //nothing found
                                    if ($res_count == 0){
                                            echo "
                                                    <div style='background-color:#e69e50;float:left; display:inline;'>
                                                      <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
                                                            <div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>No matched products found.</div>
                                                      </div>
                                                    </div>
                                            ";
                                    }

                                    echo "
                                            </div>
                                        </div>";
                                break;
                            //search when the keywords are numberic.
                            case 3:
                                $res_count = 0;
                                $srchdb = array("prodsirna","prodlenti","prodadenovirus","prodProteinVector","prodORFVector","prodprotein","prodlysates");
                                foreach ($srchdb as $val){
                                    switch ($val){
                                        case "prodsirna":
                                            $grpName = "siRNA Lentiviruses";
                                            $links = "/searchByAccessionNo/siRNALentivirus.php?keywords=$keywords";
                                            $condi = "WHERE AccessionNumber REGEXP '^.*[^0-9]$keywords$' OR AccessionNumber REGEXP '^.*[^0-9]$keywords\..*$'";
                                            break;
                                        case "prodlenti":
                                            $grpName = "Lentiviral Vectors";
                                            $links = "/searchByAccessionNo/premadeLentivirus.php?keywords=$keywords";
                                            $condi = "WHERE AccessionNumber REGEXP '^.*[^0-9]$keywords$' OR AccessionNumber REGEXP '^.*[^0-9]$keywords\..*$' OR AlternativeAccession REGEXP '^.*[^0-9]$keywords' OR AlternativeAccession REGEXP '^.*[^0-9]$keywords\..*$'";
                                            break;
                                        case "prodadenovirus"://dbno=4
                                            $grpName = "Premade Adenoviruses";
                                            $links = "/searchByAccessionNo/premadeAdenovirus.php?keywords=$keywords";
                                            $condi = "WHERE AccessionNumber REGEXP '^.*[^0-9]$keywords$' OR AccessionNumber REGEXP '^.*[^0-9]$keywords\..*$' OR OtherAccession REGEXP '^.*[^0-9]$keywords' OR OtherAccession REGEXP '^.*[^0-9]$keywords\..*$'";
                                            break;
                                        case "prodProteinVector"://dbno=53=========================
                                            $grpName = "Protein Vectors";
                                            $links = "/searchByAccessionNo/premadeProteinVectors.php?keywords=$keywords";
                                            $condi = "WHERE AccessionNumber REGEXP '^.*[^0-9]$keywords$' OR AccessionNumber REGEXP '^.*[^0-9]$keywords\..*$'";
                                            break;
                                        case "prodORFVector"://dbno=54=========================
                                            $grpName = "ORF cDNA Vectors";
                                            $links = "/searchByAccessionNo/premadeORFVectors.php?keywords=$keywords";
                                            $condi = "WHERE AccessionNumber REGEXP '^.*[^0-9]$keywords$' OR AccessionNumber REGEXP '^.*[^0-9]$keywords\..*$'";
                                            break;
                                        case "prodprotein"://dbno=32
                                            $grpName = "Recombinant Proteins";
                                            $links = "/searchByAccessionNo/iPSC-RP.php?keywords=$keywords";
                                            $condi = "WHERE AccessionNumber REGEXP '^.*[^0-9]$keywords$' OR AccessionNumber REGEXP '^.*[^0-9]$keywords\..*$'";
                                            break;
                                        case "prodlysates"://dbno=12======================
                                            $grpName = "Cell Lysate";
                                            $links = "/searchByAccessionNo/CellLysate.php?keywords=$keywords";
                                            $condi = "WHERE accessionNo REGEXP '^.*[^0-9]$keywords$' OR accessionNo REGEXP '^.*[^0-9]$keywords\..*$'";
                                            break;


                                    }
                                    $srch = "select sn from `$val` $condi"; 
                                    $srchRes = mysql_query($srch,$db);
                                    $srchrows = mysql_num_rows ($srchRes);
                                    /*$srch = "select count(sn) AS NumberOfQuery from `$val` $condi"; 
                                    $srchRes = mysql_query($srch,$db);
                                    $srch_r = mysql_fetch_array($srchRes);
                                    $srchrows = $srch_r['NumberOfQuery'];*/
                                    if ($srchrows == 0){
                                            continue;
                                    }elseif ($srchrows == 1){
                                            $res_count ++;
                                            $alink = "<a href='$links'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>match</span>";
                                    }elseif ($srchrows > 0){
                                            $res_count ++;
                                            $alink = "<a href='$links'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>matches</span>";
                                    }

                                    //$srch_r = mysql_fetch_array($srchRes);
                                    echo "
                                            <div style='background-color:#e69e50;float:left; display:inline;'>
                                              <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
                                                    <div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>$grpName</div>
                                                    <div style='padding-top:15px; height:55px; margin:5px 10px 5px 5px; font-size:40px; color:#00f; text-align:center; line-height:50px;'>$alink</div>
                                              </div>
                                            </div>
                                    ";
                                    }
                                    //nothing found
                                    if ($res_count == 0){
                                            echo "
                                                    <div style='background-color:#e69e50;float:left; display:inline;'>
                                                      <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
                                                            <div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>No matched products found.</div>
                                                      </div>
                                                    </div>
                                            ";
                                    }

                                    echo "
                                            </div>
                                        </div>";
                                break;
                        }
                        
                break;
            
		case '5' ://search by miRNA Name
			echo "<script language=javascript>document.getElementById('srchby').selectedIndex=3;</script>";
				$keywords = str_replace ('-','',$keywords);
				$keywords = str_replace (' ','',$keywords);
				
				$subs="select * from premade_mirna_exp where INSTR(replace(trim(miRNAName),'-',''),'$keywords') order by miRNAName";
				$subres=mysql_query($subs,$db);
				$subrw=mysql_num_rows($subres);
				if ($subrw>0){
					echo"
						<div id='srchResultTitle'>Search Results for miRNA: <span style='color:#F00; font-weight:bold; font-family:Arial, Helvetica, sans-serif;'>".strtoupper($keywords)."</span></div>
						<div id='homepage_block'>
  							<div id='homepage_line1'>";
					
						$srchdb = array("premade_mirna_expHUMAN","premade_mirna_expMOUSE","premade_mirna_expRAT","mirna_primers_setsHUMAN","mirna_primers_setsMOUSE","mirna_primers_setsRAT","mirna_UTR");
						
						foreach ($srchdb as $val){
							switch ($val){
								case "premade_mirna_expHUMAN":
									$val = 'premade_mirna_exp';
									$grpName = "miRNA Vectors (Human)";
									$links = "/miRNA/expression/srch_exp.php?mirnagene=$keywords&species=Human&csn=26&ssn=11838&dsn=12251";
									$condi = "where INSTR(replace(trim(miRNAName),'-',''),'$keywords') and species='Human'";
									break;
								case "premade_mirna_expMOUSE":
									$val = 'premade_mirna_exp';
									$grpName = "miRNA Vectors (Mouse)";
									$links = "/miRNA/expression/srch_exp.php?mirnagene=$keywords&species=Mouse&csn=26&ssn=11838&dsn=12251";
									$condi = "where INSTR(replace(trim(miRNAName),'-',''),'$keywords') and species='Mouse'";
									break;
								case "premade_mirna_expRAT":
									$val = 'premade_mirna_exp';
									$grpName = "miRNA Vectors (Rat)";
									$links = "/miRNA/expression/srch_exp.php?mirnagene=$keywords&species=Rat&csn=26&ssn=11838&dsn=12251";
									$condi = "where INSTR(replace(trim(miRNAName),'-',''),'$keywords') and species='Rat'";
									break;
								case "mirna_primers_setsHUMAN":
									$val = 'mirna_primers_sets';
									$grpName = "miRNA Primers (Human)";
									$links = "/miRNA/miRNAprimers/srch_primers_sets.php?mirnaname=$keywords&species=Human&csn=26&ssn=11839&dsn=12258";
									$condi = "where INSTR(replace(trim(miRNAName),'-',''),'$keywords') and species='Human'";
									break;
								case "mirna_primers_setsMOUSE":
									$val = 'mirna_primers_sets';
									$grpName = "miRNA Primers (Mouse)";
									$links = "/miRNA/miRNAprimers/srch_primers_sets.php?mirnaname=$keywords&species=Mouse&csn=26&ssn=11839&dsn=12258";
									$condi = "where INSTR(replace(trim(miRNAName),'-',''),'$keywords') and species='Mouse'";
									break;
								case "mirna_primers_setsRAT":
									$val = 'mirna_primers_sets';
									$grpName = "miRNA Primers (Rat)";
									$links = "/miRNA/miRNAprimers/srch_primers_sets.php?mirnaname=$keywords&species=Rat&csn=26&ssn=11839&dsn=12258";
									$condi = "where INSTR(replace(trim(miRNAName),'-',''),'$keywords') and species='Rat'";
									break;
								case "mirna_UTR":
									$val = 'mirna_human_genes';
									$variable = 'miRNA';
									$grpName = "3'UTR Vectors";
									$links = "/miRNA/srch_valid.php?tbl=mirna_human_genes&subj=mirna&mirna=$keywords&csn=26&ssn=11838&dsn=12288";
									$condi = "where INSTR(replace(trim(miRNA),'-',''),'$keywords') group by miRNA";
									break;
							}
							$srch = "select * from $val $condi"; 
							$srchRes = mysql_query($srch,$db);
							$srchrows = mysql_num_rows ($srchRes);
							if ($srchrows == 0){
								$alink = "<span style='color:#AAA;'>$srchrows</span>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>matches</span>";
							}elseif ($srchrows == 1){
								$alink = "<a href='$links'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>match</span>";
							}else{
								$alink = "<a href='$links'>$srchrows</a>&nbsp;<span style='font-size:10px; color:#000; text-decoration:none;'>matches</span>";
							}
							echo "
								<div style='background-color:#e69e50;float:left; display:inline;'>
								  <div style='margin:2px; width:152px; height:120px; border-left:2px solid #FFF; border-top:2px solid #FFF; border-right:2px solid #ad9378; border-bottom:2px solid #ad9378;  background-color:#e6f8eb;'>
									<div style='height:auto; margin:5px 10px 5px 5px; font-size:12px; color:#000; font-weight:bold; text-align:center;'>$grpName</div>
									<div style='padding-top:15px; height:55px; margin:5px 10px 5px 5px; font-size:40px; color:#00f; text-align:center; line-height:50px;'>$alink</div>
								  </div>
								</div>
							";
						}
					echo "
						  </div>
						</div>
					";
				}else{
					echo "<script language=javascript>alert('Sorry, no such miRNA Name.');location.href='index.php?cn=0&srchby=$srchby';</script>";
					exit;
				}
			break;
	}
?>
</div>
<?php 
	include('./includes/footer.php');
?>

<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://abmgood.com/piwik/" : "http://abmgood.com/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://abmgood.com/piwik/piwik.php?idsite=1" style="border:0" alt=""/></p></noscript>
<!-- End Piwik Tag -->